<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

namespace app\components;
use app\models\config\SiteForm;
use app\models\config\SeoForm;
/**
 * Description of Controller
 *
 * @author shuai
 */
class Controller extends \yii\web\Controller{
   
    
    /**
     * 一些系统设置
    */
   private $_SiteForm=null;
   /**
    * 获取系统设置
   */
   public function getSiteForm(){
       
         if($this->_SiteForm===null){
           $this->_SiteForm =SiteForm::model();
       }
       return $this->_SiteForm;
   }
    /**
     * 一些系统设置
    */
   private $_SeoForm=null;
   /**
    * 获取系统设置
   */
   public function getSeoForm(){
     if($this->_SeoForm===null){
           $this->_SeoForm =SeoForm::model();
       }
       return $this->_SeoForm;
   }
   
   public function init() {
        $seo=$this->getSeoForm();
        $this->title=$seo->seo_title;
       $this->keywords=$seo->seo_keywords;
       $this->description=$seo->seo_description;
       return parent::init();
   }
   
   
      public $title='';
    public $keywords='';
    public $description='';
   
}
